Skip to content

feat(agent-spec): simplify resource references - #307

Merged
schickling merged 3 commits into
mainfrom
schickling/2026-08-21-resource-reference-envelope
Aug 23, 2026
Merged

feat(agent-spec): simplify resource references#307
schickling merged 3 commits into
mainfrom
schickling/2026-08-21-resource-reference-envelope

Conversation

@schickling

Copy link
Copy Markdown
Contributor

Summary

  • make reason mandatory on every Agent Spec Resource reference
  • remove the generic relation field
  • add optional inactive-reason so append-mostly Agent Specs can retain references that are no longer active for that agent

Motivation

Agent Specs are becoming the passive coordination index for agent workstreams. A local label is useful to the reading agent, while the URI carries the actual resource type and identity. The generic relation field duplicated the label/reason without establishing useful semantics.

Long-lived specs also need to retain historical references for traceability without implying that every referenced PR, worktree, or worklog remains current. inactive-reason expresses only that the reference is inactive in this Agent Spec; it does not alter the resource's lifecycle, authority, or resolution.

The resulting envelope stays intentionally small:

resource "coordination-pr" uri="github-pr://schickling/dotfiles/1887" reason="Owns the passive-coordination rollout."
resource "earlier-eval" uri="file:///.../eval.json" reason="Captured the baseline behavior." inactive-reason="Superseded by the live pilot."

Verification

  • cargo test -p agent-spec - PASS (68 tests across unit/integration targets)
  • cargo test --all-targets --all-features - Resource/parser changes PASS; one unrelated runtime test, incomplete_apply_marker_blocks_declarations_but_not_the_state_plane, is RED locally and was not modified by this PR
  • cargo fmt --all -- --check - PASS

@schickling
schickling marked this pull request as ready for review August 21, 2026 14:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 363805c80c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/agent-spec/src/kdl_format.rs
Comment thread crates/agent-spec/src/spec.rs
@schickling

Copy link
Copy Markdown
Contributor Author

Rebased onto main (4629aeb#309, the darwin capability-linkat fix). The branch previously sat on 9b1a3b4, which cannot build or test on macOS (linkat on /dev/fd/N → EPERM, see #308); consumers pinning this head were blocked from Darwin builds entirely.

No semantic changes: the rebase is clean (disjoint surfaces — agent-spec/crates vs event.rs/ding). Verified at a1931fb: Linux x86_64 cargo test -p st2 --lib 343 passed / 0 failed; macOS arm64 suite green (evidence to follow in dotfiles consumer verification).

Downstream note for schickling/dotfiles#1898: once this merges, one forward bump carries both the resource-reference envelope and the darwin fix.

@schickling
schickling force-pushed the schickling/2026-08-21-resource-reference-envelope branch from 363805c to a1931fb Compare August 22, 2026 13:25
@schickling

Copy link
Copy Markdown
Contributor Author

macOS arm64 full-suite result at a1931fb: 336 passed; 1 failed — the single failure is the same pre-existing darwin parallel-load flake family in codex_app_server (subscribed_control_pump_delivers_a_typed_reference_to_the_real_fifo_head, Attempted≠Accepted); it passes in isolation (1 passed; 0 failed) and is untouched by this branch or #309. All ding/event/archive tests green.

…rations and docs

Codex review (P1): requiring reason invalidated the repository's own
examples — validate.rs/status_agents.rs fixtures parse-errored into empty
rosters, and README/vrs spec still documented a name+uri-only envelope.
Add reason to every bundled declaration and update the contract prose to
name+uri+reason with optional inactive-reason.
Codex review (P2): normalize_agent projected only /resources/<name>/uri,
so edits touching just reason or inactive-reason produced a modified-file
marker with no agent semantic field. Emit /reason and optional
/inactive-reason alongside /uri so diff consumers can observe explanation
and active-state changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant